package com.gali.lovefinder.constant;

import lombok.Getter;

/**
 * LoginTypeEnum:
 *
 * @author gali
 * @date 2023/07/09
 */
@Getter
public enum LoginTypeEnum {
    EMAIL("email", RedisConstant.REDIS_KEY_EMAIL_MESSAGE);

    private final String loginType;

    private final String redisKey;

    LoginTypeEnum(String loginType, String redisKey) {
        this.loginType = loginType;
        this.redisKey = redisKey;
    }

    public static LoginTypeEnum getLoginTypeEnum(String loginType) {
        for (LoginTypeEnum value : values()) {
            if (value.loginType.equals(loginType)) {
                return value;
            }
        }
        throw new IllegalArgumentException("Invalid login type");
    }
}
